/* Here, you should not change anything else than the argument in the call below */

/*
 * The problem with darken and lighten is:
 * window.onload can't be executed in both
 *
 */

$(document).ready(function() {
    Darken.darkenElement('#topleft');    
});

var Darken = {
	/*
	 * Takes an id to an element and darkens its colour a notch...
	 * You should implement the darkenElement(id) function.
	 */
	darkenElement: function(id) {
            var color = $(id).css('backgroundColor');
            var color2 = new RGB(color);
            color2.subRGB(30, 30, 30);
            $(id).hover(
                function(){$(id).css("backgroundColor",color2.getHex());}, 
                function(){$(id).css("backgroundColor",color);}
            );
    }
}